home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS065.dsk
/
STATEMENT INVOICE.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
4KB
|
96 lines
10 TEXT : HOME
20 D$ = "<CTRL-D>": PRINT D$;"NOMON I,O,C"
30 DIM L$(20): DIM AM(20): DIM LI$(20)
40 HOME : PRINT : PRINT
50 INPUT "WHOSE STATEMENT ";SS$
60 PRINT : INPUT "MONTH ";SM$
70 PRINT : INPUT "1 IF YOU WANT PIECE PRICES ";PC$:PC = VAL(PC$)
80 W = 0
90 W = W +1
100 HOME : VTAB (15): PRINT "ENTER A Q": PRINT : PRINT "IF THERE ARE NO MORE INVOICES ": VTAB (3)
110 INPUT " LOT # ";L$(W)
120 IF L$(W) = "Q" THEN W = W -1: GOTO 450
130 GOTO 320
140 REM WAIT UNTIL KEY IS PUNCHED
150 VTAB (21): PRINT "PRESS ANY KEY TO CONTINUE"
160 Y = PEEK( -16384): IF Y >127 THEN POKE -16368,0: GOTO 190
170 GOTO 160
180 .333 *7
190 AM(W) = SUM:SUM = 0:X = 0:X$ = ""
200 LI$(W) = INV$
210 REM ROUTINE TO COMBINE INVOICES FOR EACH LOT
220 IF W = 1 THEN GOTO 90
230 AQ = W -1
240 FOR N = 1 TO AQ
250 IF L$(N) = L$(W) THEN GOTO 280
260 NEXT N
270 LI$(N) = INV$: GOTO 90
280 AM(N) = AM(N) +AM(W)
290 LI$(N) = LI$(N) +"-" +INV$
300 W = W -1
310 GOTO 90
320 CALL -958
330 PRINT : INPUT "INVOICE # ";INV$
340 IF PC = 0 THEN 380
350 NM = 5
360 PRINT : INPUT "INPUT # OF ITEMS ";NI$: IF NI$ < >"" THEN NI = VAL(NI$): INPUT "PRICE PER PIECE";PI$:PI = VAL(PI$):LT = PI *NI:I = LT +I: VTAB (NM): PRINT : PRINT NI;" @ ";PI;" = ";LT: CALL -958:NM = NM +1: GOTO 360
370 GOTO 390
380 PRINT : INPUT "INVOICE TOTAL ";I$:I = VAL(I$):
390 PRINT :CV = PEEK(37) -3: INPUT "DISCOUNT ";DI$: IF DI$ < >"" THEN D = VAL(DI$):X = I -D: GOTO 410
400 Z = .98:X = I *Z:D = I -X: POKE 37,CV:AX = X:X = D: GOSUB 680: CALL -958: PRINT "DISCOUNT ";X$:X = AX
410 GOSUB 680:SUM$ = X$
420 PRINT : PRINT : PRINT : PRINT : PRINT "TOTAL AFTER DISCOUNT "; LEFT$(X$,N)
430 SUM = VAL( LEFT$(X$,N)) +SUM
440 GOTO 140
450 HOME : PRINT : PRINT : PRINT : PRINT "FOR CHECK STUB PRINTOUT PLUG IN PRINTER": PRINT : PRINT "AND TYPE Y ";: INPUT PO$: IF LEFT$(PO$,1) = "N" THEN HOME : PRINT : PRINT : PRINT : GOTO 820
460 HOME : PRINT D$;"PR#2": PRINT "<CTRL-I>80N": PRINT : PRINT
470 PRINT SS$" - ";SM$: PRINT
480 TY = 0
490 FOR S = 1 TO W
500 X = AM(S): GOSUB 680
510 PRINT "LOT # ";L$(S);" = ";X$
520 PRINT "# S "; LEFT$(LI$(S),25)
530 IF LEN(LI$(S)) >25 THEN PRINT MID$ (LI$(S),26,30)
540 IF LEN(LI$(S)) >55 THEN PRINT MID$ (LI$(S),56,30)
550 IF LEN(LI$(S)) >85 THEN PRINT MID$ (LI$(S),86,30)
560 IF LEN(LI$(S)) >115 THEN PRINT MID$ (LI$(S),116,30)
570 IF LEN(LI$(S)) >145 THEN PRINT MID$ (LI$(S),146,30)
580 IF LEN(LI$(S)) >175 THEN PRINT MID$ (LI$(S),176,30)
590 IF LEN(LI$(S)) >205 THEN PRINT MID$ (LI$(S),206,30)
600 IF LEN(LI$(S)) >235 THEN PRINT MID$ (LI$(S),236,30)
610 TY = AM(S) +TY
620 PRINT : NEXT S
630 X = TY: GOSUB 680:TY$ = X$
640 PRINT
650 PRINT "TOTAL = $ ";TY$
660 PRINT D$;"PR#0"
665 HOME : PRINT : PRINT "ANOTHER COPY ";Y$: IF LEFT$(Y$,1) = "Y" THEN 450
670 END
680 REM SUBROUTINE TO FORMAT NUMBERS INTO 7 DIGIT STRINGS
690 X = X +.009
700 X$ = STR$(X)
710 FOR J = 1 TO LEN(X$)
720 IF MID$ (X$,J,1) > <"." THEN NEXT J
730 REM J = LOCATION OF DECIMAL POINT
740 IF J +2 < LEN(X$) THEN X$ = LEFT$(X$,J +2): GOTO 780
750 IF J +2 = LEN(X$) THEN GOTO 780
760 IF J +1 = LEN(X$) THEN X$ = X$ +"0": GOTO 780
770 IF J -1 = LEN(X$) THEN X$ = X$ +".00": GOTO 780
780 FOR I = LEN(X$) TO 9:X$ = " " +X$: NEXT I
790 N = 10
800 X = VAL(X$)
810 RETURN
820 HOME : PRINT : PRINT : PRINT : PRINT "FOR HARD COPY PRINTOUT PLUG IN PRINTER": PRINT : PRINT "IS PRINTER ON";: INPUT PO$: IF LEFT$(PO$,1) = "N" THEN HOME : PRINT : PRINT : PRINT : GOTO 840
830 HOME : PRINT D$;"PR#2": PRINT "<CTRL-I>30N": PRINT : PRINT
840 PRINT " S T A T E M E N T": PRINT : PRINT
850 TY = 0
860 FOR S = 1 TO W
870 X = AM(S): GOSUB 680
880 PRINT "LOT # ";L$(S);" = ";X$: PRINT "# S ";LI$(S)
890 TY = AM(S) +TY
900 PRINT : NEXT S
910 X = TY: GOSUB 680:TY$ = X$
920 PRINT
930 PRINT "TOTAL = $ ";TY$
940 PRINT D$;"PR#0"
950 END